<template>
  <div class="box">
    <el-form :model="form" label-position="right" label-width="90px" :inline="true" class="demo-form-inline">
      <el-form-item label="菜单编号：" label-width="80" required>
        <el-input v-model="form.name" placeholder="系统自动生成"/>
      </el-form-item>
      <el-form-item label="菜单名称：">
        <el-input v-model="form.abbreviation" />
      </el-form-item>
      <el-form-item label="排序号：">
        <el-input v-model="form.phone" />
      </el-form-item>
      <el-form-item label="权限类型：">
        <SelectOption :options="options" @change-value="changeValue4"> </SelectOption>
      </el-form-item>
      <el-form-item label="上级菜单：">
        <SelectOption :options="options" @change-value="changeValue5"> </SelectOption>
      </el-form-item>
      <el-form-item label="菜单URL：">
        <el-input v-model="form.evCycle" />
      </el-form-item>
      <el-form-item label="制单人：">
        <el-input v-model="form.evCycle" />
      </el-form-item>
      <el-form-item label="制单时间：">
        <el-date-picker v-model="form.rdDate" type="date" placeholder="选择日期" clearable />
      </el-form-item>
    </el-form>
  </div>
</template>
<script lang="ts">
import { reactive } from 'vue'
import SelectOption from '../components/selectOption/index.vue'
import { useStore } from 'vuex'
export default {
  components: {
    SelectOption,
  },
  setup() {
    const store = useStore()

    const form = reactive(store.state.technologyStrength.form)

    const changeValue4 = (item) => form.type = item.value
    const changeValue5 = (item) => form.rdDept = item.value


    const options = [
      {
        value: 'Option1',
        label: 'Option1',
      },
      {
        value: 'Option2',
        label: 'Option2',
      },
      {
        value: 'Option3',
        label: 'Option3',
      },
      {
        value: 'Option4',
        label: 'Option4',
      },
      {
        value: 'Option5',
        label: 'Option5',
      },
    ]

    return {
      form,
      options,
      changeValue4,
      changeValue5,
    }
  },
}
</script>
<style lang="scss" scoped>
.demo-form-inline .el-form-item {
  width: 30%;
}

/deep/.labelHeight .el-form-item__label {
  line-height: 20px;
}

/deep/.el-date-editor.el-input {
  width: 100%;
}

/deep/.el-date-editor.el-input__inner {
  width: 100%;
}

/deep/.demo-form-inline .el-select {
  width: 100%;
  margin: 0;
}

.el-select {
  width: 100%;
  margin: 0;
}

.selectLabel {
  width: 70%;
  height: 40px;
  line-height: 40px;
  padding: 0 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: inline-block;
}

.addLabel {
  display: inline-block;
  width: 120px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  background-color: #169bd5;
  border-radius: 6px;
  color: #fff;
  margin-left: 15px;
}

.unitBox {
  width: 100%;
  margin: 30px 0;

  .title {
    padding: 15px 0;
    border-bottom: 1px solid #ccc;
  }

  .tagBox {
    margin-top: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
  }
}

.el-tag {
  margin-right: 10px;
}
</style>
  